<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="Dao.*"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>重置密码</title>
</head>
<body>
	<%
		String no = request.getParameter("no");
		String status = request.getParameter("status");
		session.setAttribute("session_no", no);
		session.setAttribute("session_status", status);
	%>
	<script type="text/javascript">
	function len(s) {
		var l = 0;
		var a = s.split("");
		for (var i=0;i<a.length;i++) {
		if (a[i].charCodeAt(0)<299) {
		l++;
		} 
		else {
		l+=2;
		}
	}
		return l;
	}
		function checkIfSame() {
			var newPwd = resetPwd_form.newPwd.value;
			var rePwd = resetPwd_form.rePwd.value;
			var newPwdLength=len(newPwd);
			if (newPwd == rePwd&&newPwdLength>=6&&newPwdLength<=12) {
				//alert("两次输入的密码一样！" + newPwd + "<br/>" + rePwd);
				return true;
			}
			else if(newPwd!=rePwd){
				alert("两次输入的密码不一样！" + '\r\n'+"第一次："+newPwd + '\r\n' + "第二次："+rePwd);
				return false;
			}
			else if(newPwdLength<6||newPwdLength>12){
				alert("密码长度必须在6~12位之间");
				return false;
			}
		}
	</script>
	<link href="css/findPwd.css" rel="stylesheet" type="text/css" />
	<div class="header">
		<img src="img/findPwdBanner.jpg" height="150px" width="1500px">
	</div>
	<div class="body">
		<form action="resetPwd_result.jsp" method=""
			post"" name="resetPwd_form" onsubmit="return checkIfSame();">
			<table width="600" height="200" border="0" align="center">
				<%-- <input type="hidden" name="no" value=<%=request.getParameter("no")%>/>
		<input type="hidden" name="status" value=<%=new String(request.getParameter("status").getBytes("ISO-8859-1"), "utf-8")%>/>
		<!-- <input type="hidden" name="status" value=<%new String(request.getParameter("status").getBytes("ISO-8859-1"), "utf-8") %>/> --> --%>
				<tr>
					<td align="right">请输入新的密码：</td>
					<td><input type="password" name="newPwd" class="input">
				</tr>
				<tr>
					<td align="right">请重新输入密码：</td>
					<td><input type="password" name="rePwd" class="input">
				</tr>
				<tr align="center">
					<td colspan="2"><input type="submit" name="submit" value="确定"
						class="mybutton" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div class="foot">
		<center>
			<font color="white">Made by Aaron</font>
		</center>
	</div>

</body>
</html>